package gwt.immunology.job;

import models.Patient;
import play.Play;
import play.Play.Mode;
import play.jobs.Job;
import play.jobs.OnApplicationStart;
import play.test.Fixtures;

@OnApplicationStart
public class BootstrapJob extends Job {

    @Override
    public void doJob() throws Exception {
        if (Play.mode == Mode.DEV && Patient.count() == 0) {
            Fixtures.loadModels("data.yml");
        }
    }
}
